package cn.sdhuijin.vms.model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "t_reader")
public class Reader extends IdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer number;
	private String position;
	private Integer doorNumber = 1;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "controller_id")
	private Controller controller;

	public Integer getDoorNumber() {
		return doorNumber;
	}

	public void setDoorNumber(Integer doorNumber) {
		this.doorNumber = doorNumber;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	/**
	 * 读卡器位置 out 出 in 入
	 * 
	 * @return
	 */
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public Controller getController() {
		return controller;
	}

	public void setController(Controller controller) {
		this.controller = controller;
	}

	@Override
	public String toString() {
		return "Reader [number=" + number + ", position=" + position
				+ ", controller=" + controller + "]";
	}

}
